#ifndef LIBACCENT_ALGORITHMS_MISMATCH_HPP
#define LIBACCENT_ALGORITHMS_MISMATCH_HPP

#include "accent/algorithms/drop_while.hpp"
#include "accent/functional/equals.hpp"
#include <utility>

namespace accent
{

  template <typename ForwardRange1, typename ForwardRange2,
            typename BinaryPredicate>
  std::pair<typename ForwardRange1::position,
            typename ForwardRange2::position>
    mismatch(ForwardRange1 r1, ForwardRange2 r2, BinaryPredicate p)
  {
    auto rs = drop_matching(r1, r2, p);
    return std::make_pair(rs.first.front_position(),
                          rs.second.front_position());
  }

  template <typename ForwardRange1, typename ForwardRange2>
  std::pair<typename ForwardRange1::position,
            typename ForwardRange2::position>
    mismatch(ForwardRange1 r1, ForwardRange2 r2)
  {
    return ::accent::mismatch(r1, r2, equals());
  }

}

#endif
